/* eslint-disable react/prop-types */
import { Component } from "react";
import { NavBar } from "antd-mobile";

/**
 * 使用说明：该组件可绑定属性 title，自定义标题，提高组件复用性
 */
class MyNavBar extends Component {
  render() {
    return (
      <div>
        <NavBar
          back="返回"
          onBack={() => {
            window.history.go(-1);
          }}
        >
          {this.props?.title ? this.props?.title : "MyNavBar"}
        </NavBar>
      </div>
    );
  }
}

export default MyNavBar;
